// Copyright  2011, 2012 Petr TALLA. [petr.talla@gmail.com]
// This file is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY;  without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
// [http://www.gnu.org/copyleft/lesser.html]
//=============================================================================
#pragma once

#include "./TcArg.h"
#include <list>

class TcArgVal;

//=============================================================================
class TcArgCol : public TcArg {
//=============================================================================
public:
//<CONSTRUCTION>
    TcArgCol(const char* name = "");
    ~TcArgCol();
//<ITEMS>
    TcArgVal* appendVal(const char* value, const char* name = "");
    TcArgVal* appendVal(int value, const char* name = "");
    TcArgCol* appendCol(const char* name = "");
    int appendError(const char* value, ...);

    int count() const {return items_.size(); };
    TcArg* at(int index);

    TcArgVal* getVal(const char* name, int index = 0);
    const char* value(const char* name, const char* defaultArg = "", int index = 0);
    int count(const char* name); //TODO const;
//=============================================================================
//<OVERRIDES>
    virtual void toString(std::string& result);
    virtual TcArgCol* getAsCol() { return this; };
protected:
//<DATA>
    std::list<TcArg*> items_;
//<FRIENDS>
    friend class TcCmdTransl;
    friend class TcHtmlView; //Temp
};
